// const http = uni.$u.http

const url = require('../config.js').baseUrl

import { getOsType, getAppVersion, getOsversion } from "@/common/util/constants.js"

// 初始化接口地址
const AppInitDataApi = `/init/appInitData/v1`
const SystemInfo = uni.getSystemInfoSync()

let osType = getOsType()
let osVersion = getOsversion()

// 获取初始化数据
export function getAppInitData(){
	
	return new Promise((resolve,reject)=>{
		uni.request({
			url: url + AppInitDataApi,
			method: 'post',
			data: {
				osType,
				osVersion
			},
			success:result=>{
				if (result.code == 200) {
						resolve(result.data)
						// "data": {
						//     "appVersionVo": {
						//         "osType": null,
						//         "osVersion": null,
						//         "url": null,
						//         "isNew": 0,
						//         "isForce": null
						//     },
						//     "secret": "/g*xK+S]a#GCQ3os",
						//     "appId": "iZhiBao#$_",
				}
			}
		})
	})
}


